const treeModel = {
  checkByUsername: 'select * from planting_tree where username = ?',
  // list: 'select * from planting_tree', // 
  // list2: 'select planting_tree.*, GROUP_CONCAT(planting_tree_specification.planting_tree_id) AS planting_tree_specification_count FROM planting_tree LEFT JOIN planting_tree_specification ON planting_tree.id = planting_tree_specification.planting_tree_id GROUP BY planting_tree.id ORDER BY planting_tree.sort DESC, planting_tree.created_at DESC LIMIT 10 OFFSET 0',
  list: 'SELECT planting_tree.*, COUNT(planting_tree_specification.planting_tree_id) AS planting_tree_specification_count FROM planting_tree LEFT JOIN planting_tree_specification ON planting_tree.id = planting_tree_specification.planting_tree_id GROUP BY planting_tree.id ORDER BY planting_tree.sort DESC, planting_tree.created_at DESC LIMIT 10 OFFSET 0',
  paramsList: 'select * from planting_tree', // 
  // list: 'select * from system_item_setting order by sort asc', //升序
  add: 'insert into planting_tree set ?',
  addUser: 'insert into planting_tree set ?',
  delete: 'delete from planting_tree where id=?',
  update: 'update planting_tree set ? where id=?'
}

module.exports = treeModel
